#ifndef PATHFINDER_H
#define PATHFINDER_H

#include <QThread>
#include <stdlib.h>
#include <QImage>
#include <QColor>
#include <QPoint>
#include "pathmap.h"
#include "micropather.h"

#define PIX_PER_POINT 10

class PathFinder : public QThread
{
    Q_OBJECT

public:
    PathFinder(QImage mapMask, QObject *parent);

    void run();
    PathMap * getPathMap();
    void setPointPassable(int x, int y, bool isPassable);

public slots:
    void solvePath(QPoint start, QPoint finish, QObject * sender);

signals:
    void pathSolved(std::vector<void*> path, QObject * receiver);

private:
    PathMap * pathMap;
    MicroPather * pather;
    std::vector<void*> tempPath;
    float pathCost;
};

#endif // PATHFINDER_H
